<template>
    <div class="createOrder" v-loading="loading" element-loading-text="加载中"
        element-loading-background="rgba(250, 250, 250, 0.5)" element-loading-spinner="el-icon-loading">
        <div class="title">{{ title }}</div>
        <div class="formArea">
            <el-form :model="createForm" :rules="rules" ref="createForm" label-width="100px" size="mini" 
                    :hide-required-asterisk="true">
                <el-form-item label="产品编号">
                    <el-input v-model="createForm.code" placeholder="请输入,忽略将自动生成" :disabled='disabled' :maxlength="120"></el-input>
                </el-form-item>
                <el-form-item label="产品名称" prop="name">
                    <template slot='label'>
                        <span style="color: red">*</span>
                        产品名称
                    </template>
                    <el-input v-model="createForm.name" placeholder="请输入" :maxlength="120"></el-input>
                </el-form-item>
                <el-form-item label="库存单位" prop="unitName">
                    <template slot='label'>
                        <span style="color: red">*</span>
                        库存单位
                    </template>
                    <el-select v-model="createForm.unitName" filterable remote reserve-keyword
                        placeholder="请选择" :remote-method="remoteMethod_unit" :loading="selLoading"
                        @focus='getUnitFocus' @change="unitChange" ref="unit">
                        <el-option v-for="item in unitItems.options" :key="item.value" :label="item.label"
                            :value="item.value">
                        </el-option>
                        <div slot="empty">
                            <p style="color: rgba(0,0,0,.25);font-size:12px;padding:10px 0 0 22px;">暂无数据</p>
                            <el-button type="text" icon="el-icon-circle-plus-outline" style="padding:10px 0 10px 20px"
                                @click='createUnit'
                                >添加新单位 {{ newUnit }}
                            </el-button>
                        </div>
                    </el-select>
                </el-form-item>
                <el-form-item label="产品规格" prop="specification">
                    <el-input v-model="createForm.specification" placeholder="请输入" :maxlength="120"></el-input>
                </el-form-item>
                <el-form-item label="产品属性" prop="attribute">
                    <template slot='label'>
                        <span style="color: red">*</span>
                        产品属性
                    </template>
                    <el-select v-model="createForm.attribute"
                        placeholder="请选择"
                        ref="attribute">
                        <el-option v-for="item in attributeList" :key="item.value" :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="单价">
                    <el-input-number v-model="createForm.unitPrice" controls-position="right" :min="0"></el-input-number>
                </el-form-item>
                <el-form-item label="工艺路线" prop="processRouteName">
                    <el-select
                        v-model="createForm.processRouteName"
                        filterable
                        clearable
                        remote
                        reserve-keyword
                        placeholder="请选择"
                        :remote-method="processRouteSearch"
                        :loading="selLoading"
                        @focus='getProcessRouteFocus'
                        @clear="clearProcessRouteName">
                        <el-option
                            v-for="item in processRouteData.options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="最大库存">
                    <el-input-number v-model="createForm.maximum" controls-position="right" :min="0" :max="9999999999.999998"></el-input-number>
                </el-form-item>
                <el-form-item label="最小库存">
                    <el-input-number v-model="createForm.minimum" controls-position="right" :min="0" :max="9999999999.999998"></el-input-number>
                </el-form-item>
                <el-form-item label="安全库存">
                    <el-input-number v-model="createForm.safe" controls-position="right" :min="0" :max="9999999999.999998"></el-input-number>
                </el-form-item>

                <el-form-item label="库存数量">
                    <span>{{ createForm.stock }}</span>
                </el-form-item>

                <!-- ====================自定义==================== -->
                <el-form-item
                    v-for='(item, i) in customFiledList'
                    :key="i" 
                    :label='item.chineseName'
                    :prop="item.id"
                    v-show='hiddenRule(item)'
                >
                    <el-checkbox-group v-show="false" v-model="createForm[item.id]"></el-checkbox-group>
                    <template slot='label'>
                        <span style="color: red" v-show="requireRsterisk(item)">*</span>
                        {{ item.chineseName }}
                        <el-tooltip class="item" effect="dark" :content="item.tips" placement="top" v-show='item.tips'>
                            <span class="iconfont icon-wenhao wenhao"></span>
                        </el-tooltip>
                    </template>
                    <formLibrary :formItem='item' @formItemHandle='formItemHandle' :defaultData="defaultData" @uploadProgress='uploadProgress' ref='formLibrary'></formLibrary>
                </el-form-item>
            </el-form>
        </div>
        <div class="btn">
            <el-button type="primary" plain size="small" @click="handleCancel">取消
            </el-button>
            <el-button type="primary" size="small" @click="save">保存</el-button>
        </div>
    </div>
</template>

<script>
    import {
        productHandle,
        unitHandle,
        unitList,
        prOther,
        productDetail
    } from '@/api/baseController'
    import {
        customFieldOther,
        fillFieldMess
    } from '@/api/customFieldController'
    import {
        loginUserMess
    } from '@/api/loginController'
    import formLibrary from '@/components/formLibrary'
    export default {
        data() {
            return {
                customFiledList: [],
                title: '创建产品',
                successMsg: '创建成功',
                createForm: {
                    code: '',
                    name: '',
                    unitName: '',
                    specification: '',
                    processRouteName: '',
                    unitPrice:0,
                    stock: '0',
                    id: '',
                    maximum: undefined,
                    minimum: undefined,
                    safe: undefined,
                    attribute: 0
                },
                rules: {
                    name: [{
                        required: true,
                        message: '产品名称不能为空',
                        trigger: 'blur'
                    }],
                    unitName: [{
                        required: true,
                        message: '库存单位不能为空',
                    }]
                },
                attributeList: [
                    {
                        value: 0,
                        label: '自制'
                    },
                    {
                        value: 1,
                        label: '外购'
                    },
                    {
                        value: 2,
                        label: '委外'
                    }
                ],
                unitIsShow: false,
                unitItems: {
                    options: [],
                    num: 0
                },
                addUintName: '',
                disabled: false,
                loading: false,
                selLoading: false,
                processRouteData: {
                    options: [],
                    num: 0
                },
                newUnit: '',
                defaultData: [], // 自定义字段值
                customFiledData: [],
                customState: true, // 判断单选/复选 选值是否正确
                customErrorLabel: '',// 选值错误提示语
                // 关联属性信息
                relevanceProp: [],
                userMess: {},
                uploadFlag: true,
            }
        },
        components: {
            formLibrary
        },
        // created() {
            
        // },
        created() {
            var routerData = this.$route.meta.breadList
             let obj = {
                limit: 100,
                page: 1,
                name: ''
            }

            let data = {
                id: this.$route.query.id
            }
            this.loading = true
            if(this.$route.query.new) {
                this.title = '编辑产品'
                this.successMsg = '编辑成功'
                this.getProductDetail(data)
                this.disabled = true
            } else {
                this.getCustomFieldOther()
            }
            this.$route.meta.breadList[routerData.length - 1].name = this.title
            this.getUnitList(obj)
            this.getPrOther(obj)
        },
        methods: {
            // 接口===========================
            // 自定义字段
            getCustomFieldOther() {
                customFieldOther({type: 'product'}).then(res => {
                    this.customFiledList = []
                    this.relevanceProp = []
                    this.uploadData = []
                    if(res.code == 200) {
                        // 自定义字段数据
                        res.data.map(item => {
                            item.customFieldMess.objectsValue = item.objectsValue
                            this.customFiledList.push(item.customFieldMess)
                        })
                        // 添加自定义字段的校验规则(是否必填)
                        this.customFiledList.map(item => {
                            let r = item.hidden
                            item.hidden = r.replace(/\${产品./g, 'formItemData["').replace(/\}/g, '"]').replace(/\${用户信息./g,'userFormItemData["')
                            item.id = item.id + ''
                            let obj = {}
                            if(JSON.parse(item.fieldAttribute).required && item.fieldType != 'inputNumber') {
                                obj[item.id] = [{
                                    required: true,
                                    message: item.chineseName + '不能为空'
                                }]
                            }else if(item.fieldType == 'inputNumber'){
                                const numberRule = (rule, v, callback) => {
                                    let tempValue = ''
                                    let index = String(this.createForm[item.id]).indexOf('.')
                                    tempValue = index != -1 ? String(this.createForm[item.id]).slice(0,index) : String(this.createForm[item.id])
                                    if (!this.createForm[item.id] && item.isRequired) {
                                        return callback(new Error(`${item.chineseName}不能为空！`));
                                    }else if(tempValue.length > 10){
                                        return callback(new Error('整数位最多支持10位数字'));
                                    }else if(this.createForm[item.id] != undefined && !(/^[0-9]+(.[0-9]{1,6})?$/.test(this.createForm[item.id]))){
                                        return callback(new Error('小数点后最多保留6位数字'));
                                    }else {
                                        callback()
                                    }
                                }
                                obj[item.id] = [{
                                    validator: numberRule,
                                    trigger:'blur'
                                }]
                            }
                            this.rules = Object.assign(this.rules, obj)
                            if(item.fieldType == 'relevanceProp') {
                                this.relevanceProp.push({
                                    id: item.id,
                                    objectFieldId: item.objectFieldId,
                                    type: item.correlationField
                                })
                            }
                        })
                        this.getLoginUserMess()
                    }
                })
            },
            // 产品详情--由编辑进入
            getProductDetail(data) {
                productDetail(data).then(res => {
                    if(res.code == 200) {
                        // 表单项赋值
                        for(let i in this.createForm) {
                            this.createForm[i] = res.data[i]
                        }
                        this.createForm.maximum == null ? this.createForm.maximum = undefined : ''
                        this.createForm.minimum == null ? this.createForm.minimum = undefined : ''
                        this.createForm.safe == null ? this.createForm.safe = undefined : ''
                        this.customFiledData = []
                        this.defaultData = []
                        
                        this.getCustomFieldOther()

                        // 不为null说明该条数据有自定义字段，将自定义字段值初始化给表单
                        if(res.data.customFieldVos != null) {
                            res.data.customFieldVos.map(item => {
                                this.$set(this.createForm, item.customFieldId, item.value)
                                this.customFiledData.push({
                                    customFieldId: item.customFieldId,
                                    value: item.value
                                })
                                this.defaultData.push({
                                    customFieldId: item.customFieldId,
                                    value: item.value
                                })
                            })
                            this.createForm.id = res.data.id
                        //     this.defaultData = this.createForm
                        }
                    }
                })
            },
            // 关联对象-字段信息
            getFillFieldMess(data, fillRule, n) {
                fillFieldMess(data).then(res => {
                    this.defaultData = []
                    for(let key in this.createForm) {
                        if(Number(key)) {
                            this.defaultData.push({
                                customFieldId: key,
                                value: this.createForm[key]
                            })
                        }
                    }
                    if(res.code == 200) {
                        // 如果该条数据有自定义字段
                        if(res.data.customFieldVos != null) {
                            /* 
                                遍历关联对象的填充规则
                                遍历该条数据的自定义字段列表
                                将填充规则中的来源值(from) 赋给 指定控件(to)
                            */
                            fillRule.map(item => {
                                let dataArr = []
                                let f = res.data.customFieldVos.find(res => { return res.customFieldId == item.from })
                                if(f != undefined) {
                                    res.data.customFieldVos.map(k => {
                                        if(k.customFieldId == item.from) {
                                            this.createForm[item.to] = k.value
                                            this.defaultData = this.defaultData.filter(j => j.customFieldId != item.to)
                                            this.defaultData.push({
                                                customFieldId: item.to,
                                                value: k.value
                                            })
                                        }
                                    })
                                } else {
                                    this.createForm[item.to] = ''
                                    this.defaultData.map(k => {
                                        if(k.customFieldId == item.to) {
                                            let d = this.customFiledList.find(res => { return res.id == item.to })
                                            if(d.fieldType == 'picture' || d.fieldType == 'upload' || d.fieldType == 'selectChecked') {
                                                dataArr.push({
                                                    customFieldId: k.customFieldId,
                                                    value: "[]"
                                                })
                                            } else { 
                                                dataArr.push({
                                                    customFieldId: k.customFieldId,
                                                    value: ""
                                                })
                                            }
                                        } else {
                                            dataArr.push({
                                                customFieldId: k.customFieldId,
                                                value: k.value
                                            })
                                        }
                                    })
                                    this.defaultData = dataArr
                                }
                            })
                        } else {
                            fillRule.map(item => {
                                let dataArr = []
                                this.createForm[item.to] = ''
                                this.defaultData.map(k => {
                                    if(k.customFieldId == item.to) {
                                        let d = this.customFiledList.find(res => { return res.id == item.to })
                                        if(d.fieldType == 'picture' || d.fieldType == 'upload' || d.fieldType == 'selectChecked') {
                                            dataArr.push({
                                                customFieldId: k.customFieldId,
                                                value: "[]"
                                            })
                                        } else { 
                                            dataArr.push({
                                                customFieldId: k.customFieldId,
                                                value: ""
                                            })
                                        }
                                    } else {
                                        dataArr.push({
                                            customFieldId: k.customFieldId,
                                            value: k.value
                                        })
                                    }
                               })
                               this.defaultData = dataArr
                            })
                        }
                        // 关联属性赋值
                        this.relevanceProp.map(item => {
                            if(item.objectFieldId == n) {
                                this.createForm[item.id] = res.data[item.type]
                                this.defaultData = this.defaultData.filter(j => j.customFieldId != item.id)
                                this.defaultData.push({
                                    customFieldId: item.id,
                                    value: res.data[item.type]
                                })
                            }
                        })
                    }
                })
            },
            // 用户信息
            getLoginUserMess() {
                loginUserMess({}).then(res => {
                    this.loading = false
                    if(res.code == 200) {
                        this.userMess = res.data
                    }
                })
            },
            // 单位
            getUnitList(data, n) {
                unitList(data).then(res => {
                    this.selLoading = false
                    if(res.code == 200) {
                        this.unitItems.options = res.data.records.map(item => {
                            return {
                                value: `${item.id}`,
                                label: `${item.name}`
                            };
                        });
                    }
                })
            },
            // 产品新增-编辑
            getProductHandle(data) {
                productHandle(data).then(res => {
                    if(res.code == 200) {
                        this.utils.showMsg(this.successMsg, 'success')
                        this.$router.push('/basicData/productDefinition')
                    }
                })
            },

            // 工艺路线下拉
            getPrOther(data) {
                prOther(data).then(res => {
                    this.selLoading = false
                    if(res.code == 200) {
                        this.processRouteData.options = res.data.map(item => {
                            return {
                                value: `${item.id}`,
                                label: `${item.name}`
                            };
                        });
                    }
                })
            },
            // 清除工艺路线
            clearProcessRouteName() {
                this.createForm.processRouteName = ''
            },

            //保存
            save() {
                this.$refs.createForm.validate((valid) => {
                    if (valid) {
                        // data: 接口入参
                        let data = {
                            code: this.createForm.code,
                            name: this.createForm.name,
                            unitId: this.unitSet(this.createForm.unitName, this.unitItems.options),
                            specification: this.createForm.specification,
                            processRouteId: this.unitSet(this.createForm.processRouteName, this.processRouteData.options),
                            stock: this.createForm.stock,
                            maximum: this.createForm.maximum == undefined ? '' : this.createForm.maximum,
                            minimum: this.createForm.minimum == undefined ? '' : this.createForm.minimum,
                            safe: this.createForm.safe == undefined ? '' : this.createForm.safe,
                            attribute: this.createForm.attribute,
                            unitPrice: this.createForm.unitPrice
                        }
                        // 有id则为修改，无id则为新建
                        this.createForm.id ? data.id = this.createForm.id : ''
                        let customData = []
                        for(let key in this.createForm) {
                            if(Number(key)) {
                                this.customFiledList.find(item => {
                                    if(
                                        item.id == key &&
                                        this.createForm[key] !== '' &&
                                        this.createForm[key] != '[]' &&
                                        this.createForm[key] != '{}' &&
                                        this.createForm[key] != null &&
                                        !(Array.isArray(this.createForm[key]))
                                    ) {
                                        customData.push({
                                            customFieldId: item.id,
                                            value: this.createForm[key]
                                        })
                                    }
                                    if(Array.isArray(this.createForm[key]) && this.createForm[key].length > 0) {
                                         customData.push({
                                            customFieldId: item.id,
                                            value: this.createForm[key]
                                        })
                                    }
                                })
                            }
                        }
                        data.customFieldVos = customData

                        // 关联对象后，判断单选框/复选框关联过来的值是否存在
                        this.customState = true
                        this.customErrorLabel = ''
                        this.customFiledList.map(item => {
                            // 单选框
                            if(item.fieldType == 'selectRadio') {
                                if(this.createForm[item.id] != '' && this.createForm[item.id] != undefined) {
                                    let s = JSON.parse(item.checkBox).find(res => { return this.createForm[item.id] == res.value })
                                    if(s == undefined) {
                                        this.customState = false
                                        this.customErrorLabel = '【' + item.chineseName + '】选项值不正确'
                                    }
                                }
                            }
                            // 复选框
                            if(item.fieldType == 'selectChecked') {
                                if(this.createForm[item.id] != '' && this.createForm[item.id] != undefined && this.createForm[item.id] != '[]') {
                                    JSON.parse(this.createForm[item.id]).map(k => {
                                        let s = JSON.parse(item.checkBox).find(res => { return res.value == k })
                                        if(s == undefined) {
                                            this.customState = false
                                            this.customErrorLabel = '【' + item.chineseName + '】选项值不正确'
                                        }
                                    })
                                }
                            }
                        })
                        if(this.customState) {
                            if(this.uploadFlag) {
                                /** 
                                 *  组件内移除图片(附件)时,
                                 * 点击保存编辑(创建)则调用组件内的删除接口，删除被移除的图片(附件)
                                 * **/
                                if(this.$refs.formLibrary != undefined) {
                                    this.$refs.formLibrary.map(k => {
                                        k.removeData('ok')
                                    })
                                }
                                this.getProductHandle(data) 
                            } else {
                                this.utils.showMsg('正在上传，请稍后', 'warning')
                            }
                        } else {
                            this.utils.showMsg(this.customErrorLabel, 'error')
                        }
                    } else {
                        return false;
                    }
                });
            },
            // 取消
            handleCancel() {
                /** 
                 *  组件内移除图片(附件)时,
                 * 点击取消编辑(创建),
                 * 表示并不是真正的删除，不调用组件内的删除，
                 * 只是清空数组，视觉上删除
                 * **/
                if(this.$refs.formLibrary != undefined) {
                    this.$refs.formLibrary.map(k => {
                        k.removeData('cancle')
                    })
                }
                this.$router.push('/basicData/productDefinition')
            },
            //工艺路线搜索
            processRouteSearch(query) {
                this.selLoading = true;
                this.getPrOther({ name: query })
            },
            getProcessRouteFocus() {
                if(this.processRouteData.num == 0) {
                    this.processRouteSearch('')
                    this.processRouteData.num++
                }
            },
            // 单位搜索
            getUnitFocus() {
                if (this.unitItems.num == 0) {
                    this.remoteMethod_unit('')
                    this.unitItems.num++
                } else {
                    if(this.newUnit != '') {
                        let obj = {
                            limit: 100,
                            page: 1,
                            name: ''
                        }
                        this.getUnitList(obj)
                    }
                }
            },
            remoteMethod_unit(query) {
                this.newUnit = query
                this.selLoading = true;
                let obj = {
                    limit: 100,
                    page: 1,
                    name: query
                }
                this.getUnitList(obj)
            },
            //新增单位
            createUnit() {
                let obj = {
                    name: this.newUnit
                }
                unitHandle(obj).then(res => {
                    if(res.code == 200) {
                        let data = {
                            limit: 100,
                            page: 1,
                            name: ''
                        }
                        this.getUnitList(data)
                    }
                })
            },
            unitSet(v, data) {
                if(!Number(v)) {
                    let id = ''
                    data.map(item => {
                        if(item.label == v) {
                            id = item.value
                        }
                    })
                    return id
                } else {
                    return v
                }
            },
            // 选择单位
            unitChange() {
                this.blurSet('unit')
            },
            blurSet(r) {
                this.$nextTick(() => {
                    this.$refs[r].blur()
                })
            },
            
            // 自定义表单项数据--表单子组件传递的值
            formItemHandle(d) {
                // 子组件的值赋给表单
                this.$set(this.createForm, d.name, d.value)
                // 操作的是关联对象
                if(d.relevanceObject != undefined) {
                    if(d.relevanceObject.id) {
                        let data = {
                            id: d.relevanceObject.id,
                            type: d.relevanceObject.businessObject
                        }
                        this.getFillFieldMess(data, d.relevanceObject.fillRule, d.name)
                    } else {
                        this.customFiledList.map(item => {
                            if(item.objectFieldId == d.name) {
                                this.createForm[item.id] = ''
                                this.defaultData.map(k => {
                                    if(k.customFieldId == item.id || k.customFieldId == d.name) {
                                        k.value = ''
                                    }
                                })
                            }
                        })
                        for(let key in this.createForm) {
                            let ind = this.defaultData.findIndex(res => {return res.customFieldId == key })
                            if(ind != -1) {
                                this.$set(this.defaultData, ind, { customFieldId: key, value: this.createForm[key] })
                            } else {
                                this.defaultData.push({
                                    customFieldId: key,
                                    value: this.createForm[key]
                                })
                            }
                        }
                    }
                }
            },
            // 自定义隐藏设置--隐藏条件触发
            hiddenRule(d) {
                let formItemData = {
                    '产品编号': this.createForm.code,
                    '产品名称': this.createForm.name,
                    '单位': this.customData(this.createForm.unitName, this.unitItems.options),
                    '产品规格': this.createForm.specification,
                    '工艺路线': this.customData(this.createForm.processRouteName, this.processRouteData.options),
                    '库存数量': this.createForm.stock,
                }
                let userFormItemData = {
                    '账号': this.userMess.account,
                    '姓名': this.userMess.name,
                    '手机号': this.userMess.mobile,
                    '角色': this.userMess.role,
                }
                this.customFiledList.map(item => {
                    if(formItemData[item.chineseName] == undefined) {
                        if(this.createForm[item.id] != undefined) {
                            formItemData[item.chineseName] = this.createForm[item.id]
                        } else {
                            formItemData[item.chineseName] = ''
                        }
                    }
                    if(userFormItemData[item.chineseName] == undefined) {
                        if(this.createForm[item.id] != undefined) {
                            userFormItemData[item.chineseName] = this.createForm[item.id]
                        } else {
                            userFormItemData[item.chineseName] = ''
                        }
                    }
                })
                let state = null
                try {
                    state = !eval(d.hidden)
                } catch {
                    state = true
                }
                //必填项字段若是被隐藏不校验
                if (this.rules[d.id]) {
                    if(d.fieldType == 'inputNumber'){
                        if(JSON.parse(d.fieldAttribute).required){ //inputNumber 必填 && 切换触发隐藏条件
                            d.isRequired = state
                        }
                    }else{
                        this.rules[d.id][0].required = state
                    }
                }
                return state
            },
            requireRsterisk(d) {
                if (this.rules[d.id]) {
                    if(d.fieldType == 'inputNumber'){
                        return JSON.parse(d.fieldAttribute).required || false
                    }else{
                        return this.rules[d.id][0].required || false
                    }
                }
            },
            customData(v, data) {
                if(Number(v)) {
                    let id = ''
                    data.map(item => {
                        if(item.value == v) {
                            id = item.label
                        }
                    })
                    return id
                } else {
                    return v
                }
            },
            // 附件/图片上传是否完成
            uploadProgress(s) {
                this.uploadFlag = s
            }
        },
        watch: {
            createForm: {
                handler(nVal, oVal) {
                    this.hiddenRule('')
                },
                deep: true,
            }
        }
    }
</script>

<style lang="less" scoped>
    .createOrder {
        overflow: auto;
        .title {
            font-size: 22px;
            padding: 20px 0 5px 20px;
        }
        .formArea {
            width: 420px;
            padding: 0px 0px 0px 60px;
        }

        .btn {
            margin: 25px 0 20px 60px;
            text-align: center;
            display: inline-block;
            width: 420px;

            /deep/ .is-plain {
                margin-right: 10px;
            }

            /deep/ .el-button--primary {
                width: 130px;
                span {
                    margin-left: 0;
                }
            }
        }

        /deep/ .el-input-number--mini {
            width: 100%;
        }

        /deep/ .el-autocomplete {
            width: 100%;
        }

        /deep/ .el-select {
            width: 100%;
        }

        /deep/ .el-range-editor--mini.el-input__inner {
            width: 100%;
        }

        /deep/ .el-table__empty-text {
            .el-empty {
                padding: 0;
            }
        }

        /deep/ .el-empty__image {
            height: 60px;
        }

        /deep/ .el-empty__image svg {
            vertical-align: text-top;
        }

        /deep/ .el-empty__description {
            margin-top: 10px;
        }

        /deep/ .el-range-editor.el-input__inner {
            width: 100%;
        }

        /deep/ .el-range-editor .el-range-input {
            flex: 7;
        }

        /deep/ .el-date-editor .el-range-separator {
            flex: 1;
        }

        /deep/ .el-input-group__append {
            background-color: #02b980;
            color: white;
        }
    }
</style>